#include "shm.hpp"
#include"fifo.hpp"
#include <unistd.h>

int main()
{
    Shm s(PATH, keynum,CREATE);
     s.Attr();
    Fifo f(PATH,NAME);
    Openfifo opf(PATH,NAME);
    opf.Open_for_write();
    char *arr = (char *)s.GetStr();
    int index=0;
   
    for (char i = 'A'; i <= 'Z'; i++,index+=2)
    {
        sleep(1);
        arr[index] = i;
        arr[index+1]=i;

        arr[index+2]=0;
        sleep(1);
        opf.wait();
        // printf("%s\n",(char*)s.GetStr());
    }

    return 0;
}